import java.math.BigDecimal;
import java.util.*;
public class Class3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[][] arr = new int[n][3];
        Map<BigDecimal,Integer> map = new HashMap<BigDecimal,Integer>();
        for (int i=0;i<n;i++){
            arr[i][0] = scanner.nextInt();
            arr[i][1] = scanner.nextInt();
            arr[i][2] = scanner.nextInt();
            BigDecimal d = BigDecimal.valueOf(arr[i][0]/arr[i][1]);
            map.put(d,map.getOrDefault(d,0)+1);
        }
        int min = Integer.MAX_VALUE;
        for (Map.Entry<BigDecimal,Integer>entry:map.entrySet()){
               min = Math.min(min,entry.getValue());
        }
        System.out.println(n-min);
     }
}
